package com.henry.customviewstudy;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import com.henry.customviewstudy.activity.BannerActivity;
import com.henry.customviewstudy.activity.CustomImageViewActivity;
import com.henry.customviewstudy.activity.CustomImgContainerActivity;
import com.henry.customviewstudy.activity.CustomProgressBarActivity;
import com.henry.customviewstudy.activity.CustomSurfaceViewActivity;
import com.henry.customviewstudy.activity.CustomTitleViewActivity;
import com.henry.customviewstudy.activity.CustomVolumeControlBarActivity;
import com.henry.customviewstudy.activity.DeepUnderstandAttrActivity;
import com.henry.customviewstudy.activity.ScanRadarActivity;
import com.henry.customviewstudy.activity.SkidRightActivity;
import com.henry.customviewstudy.activity.VDHDeepLayoutActivity;
import com.henry.customviewstudy.activity.VDHLayoutActivity;
import com.henry.customviewstudy.activity.ViewPagerLayoutManagerActivity;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
    }

    private void initView() {
        findViewById(R.id.bt_custom_view_01).setOnClickListener(this);
        findViewById(R.id.bt_custom_view_02).setOnClickListener(this);
        findViewById(R.id.bt_custom_view_03).setOnClickListener(this);
        findViewById(R.id.bt_custom_view_04).setOnClickListener(this);
        findViewById(R.id.bt_custom_view_05).setOnClickListener(this);
        findViewById(R.id.bt_custom_view_06).setOnClickListener(this);
        findViewById(R.id.bt_custom_view_07).setOnClickListener(this);
        findViewById(R.id.bt_custom_view_08).setOnClickListener(this);
        findViewById(R.id.bt_custom_view_09).setOnClickListener(this);
        findViewById(R.id.bt_custom_view_10).setOnClickListener(this);
        findViewById(R.id.bt_custom_view_11).setOnClickListener(this);
        findViewById(R.id.bt_custom_view_12).setOnClickListener(this);
        findViewById(R.id.bt_custom_view_13).setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.bt_custom_view_01:// 点击更换验证码(4位随机数字)
                startActivity(new Intent(view.getContext(), CustomTitleViewActivity.class));
                break;
            case R.id.bt_custom_view_02:// 图文搭配(上图下文)
                startActivity(new Intent(view.getContext(), CustomImageViewActivity.class));
                break;
            case R.id.bt_custom_view_03://自定义圆形进度条
                startActivity(new Intent(view.getContext(), CustomProgressBarActivity.class));
                break;
            case R.id.bt_custom_view_04://自定义音量调节
                startActivity(new Intent(view.getContext(), CustomVolumeControlBarActivity.class));
                break;
            case R.id.bt_custom_view_05://自定义ViewGroup
                startActivity(new Intent(view.getContext(), CustomImgContainerActivity.class));
                break;
            case R.id.bt_custom_view_06://深入理解自定义属性WebView
                startActivity(new Intent(view.getContext(), DeepUnderstandAttrActivity.class));
                break;
            case R.id.bt_custom_view_07://ViewDragHelper基础
                startActivity(new Intent(view.getContext(), VDHLayoutActivity.class));
                break;
            case R.id.bt_custom_view_08://ViewDragHelper高级
                startActivity(new Intent(view.getContext(), VDHDeepLayoutActivity.class));
                break;
            case R.id.bt_custom_view_09://SurfaceView实践
                startActivity(new Intent(view.getContext(), CustomSurfaceViewActivity.class));
                break;
            case R.id.bt_custom_view_10://雷达扫描图
                startActivity(new Intent(view.getContext(), ScanRadarActivity.class));
                break;
            case R.id.bt_custom_view_11://抖音效果
                startActivity(new Intent(view.getContext(), ViewPagerLayoutManagerActivity.class));
                break;
            case R.id.bt_custom_view_12://轮播图
                startActivity(new Intent(view.getContext(), BannerActivity.class));
                break;
            case R.id.bt_custom_view_13://滑动卡片
                startActivity(new Intent(view.getContext(), SkidRightActivity.class));
                break;
        }

    }
}
